Internal pull-up may sucks, check OPTION reg in the datasheet and see what happen when you set a pin to output... probably the internal pull-up get disabled 'till you set them again... use external one and post your results.