better error reporting & exit codes