Use returns instead of exit

Need to return the exit code and let the runner app perform the exit

Fixes #1838