Proper bash script terminations