Do not hardcode expected exit codes
Fix tests