Fix process exit status bug