fix some physics bugs.

Thanks @yinkaile the one who found these bugs.