Like your comment said, PORTE only has 3 pins in that PORT.
By setting the upper bits of TRISE to all 1's, you have turned on the "Parallel Slave Port" (PSP) which affects PORTD.