Some improvements and fix bug with a valid exit code ( depended on availability detect)