Completed exit generation and fixed rmexit() bug.