Fixed index error that was causing physics problems