Modified error handling on empty messages.