Fixed issue with onLeave in merit system.