Finally fixed the annoying bugs in physics