That looks fine. It uses two external resistors when none is really required, but it works.
Can you kindly explain that part, though these external resistors are not required.
I taken a look on the schematic for pin 0 and 1 and noted a 1k ohm connected.
I was suspecting a floating pin condition, but that does not appear to be your problem.
I read some few things while using an IO pin as input and using serial communication that creates some trouble . . ???
Furthermore, my Arduino was powered through my usb, i just transfered to an external power supply (9 Vdc) and get my code running as perfect, and forever . . .
Any explanation on that ?