Errors fixed in motor control