Fixed logError method to return better message.