Adding robustness and error checking to main application code.