The script now exits properly...
Merge pull request #1224 from ruimalheiro/startexit

The script now exits properly...