Better exit and exitOnError methods