trise = %11111110 ' sets bit0 of trise as output - only has 3 ports on trise
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.