better test.sh, exit with proper exit code