Script exits properly