Fixed Unit Tests and exit codes