Bug fix for physics system