Fixed a reindexing issue in the physics system.