Fixed malformed error logging