Returns integer result codes from main function

- 0 when all is fine
- 1 when an error occurred