* fixes and clean up of ending rules