Added tests for error handling code.