i2c_speed(400000) did not solve my problem! Looking at the listing file (including the one above), it puts 0x29 into SSPCON1 which is a disallowed value (at least on the PIC18F14K50 I am using...).
...
I have a very similar issue - hardware I2C running WAY slow. (The direction you would expect.) I too found that SSPADD was getting clobbered, so I manually reset it by directly writing to SSPADD. Howe ...