Program now exits properly after it ends.