Add basic error detection and abort on error.