@Peter I was just about to ask why do that and you answered.

@Micheal If pins are on the same Port, write to the whole TRIS in one go ie. don't set up individual pins as output/input. BTW pins default to input.