Exit cleanly, adjust threading