Fix bug in MessageBag isEmpty method.
Merge branch '4.0'