Fixed bugs with the impulse resolution physics engine