Changed script exit to return