Fix for motor calculations