Fix for broken error logging