Fix checkForErrors method on messages.js, it had a bug that prevented messages from being saved.