Use set -e and compile command-t for ubuntu