Arduino strange behavior with dc motors

... respectively - ie the 10uF across the 5xAA batteries, the 0.1uF across the motor1 itself. 10uF may be polarized, you should get the + and - right in that case (!)