Changed error_code tests to < 0