Proper ending of processes