Put your Port declarations before your Tris registers, so when the code turns on the outputs they will initialize in a known state.