Arduino has some strange reactions

May want to try this:
Add a 10uF cap between the reset pin and ground on the Uno board.