Applying Stefans patch to fix error handling messages here: http://issues.apache.org/jira/secure/attachment/12311640/patch.txt
Changed paths: