Fixed the gravity bugs reported in #363. Need to find a good rebuild criterion for gravity-only runs.