Some cleanup in physics + compatibility fixes