test case for issue #235
fix for issue #325 error status output overwite

could be further tidied, but it works with minimal changes