Return exit code

Fixes #439