Kind of merge from physicsDebug.

Copy of "Some changes" in physicsDebug.