DC Motors drawing too much current?

You might consider adding some decoupling capacitors to your circuit. Motors often generate interference that can affect the running of the code.
See this:-
De-coupling tutorial

Especially the Pi configuration filters at the end of this.