Fixed various bugs with gravity = top