Clean up process stop handling and error safety