Implemented a more concise UniformGrid and fixed CollisionFlags.