Validator refactored to parse $message properly

Please merge this change.