Motor control issue

Hey there, another basic electronics question here.

I'm using the arduino with an SN754410 quad half h-bridge to drive two small DC motors. The motor Vcc on the SN754410 is supplied by a 6v battery and everything shares a common ground.

I've noticed a problem: when I switch direction on both of the motors at the same time the arduino has a heart attack and resets. If I allow a "cool down" period (about one second), where the motors are allowed to come to a complete stop before reversing direction, everything works fine.

My question is, rather than introducing that cool down period, is there a hardware solution to help smooth out the spikes caused by suddenly reversing the motors?

I should add that I've tried adding various caps between the motor supply and ground, with no observable effect. Being fairly green when it comes to this stuff, I don't know whether or not that is the correct approach, or if it is, exactly what cap to use.

This is a question of decoupling, a capacitor might not be enough, see my tutorial about it:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

It is both the motor and the H-bridge chip that needs to be decoupled.