Bugfix which caused an exception while

error reporting was enabled. Added workaround for testing