Added error_reporting and a test for error