Incorrect type comparison for the MessageId

Error generated regarding incorrect type even though the type was correct. Cleaned up some of the error messages as well.