Small fixes for exitting