Added some unit tests concentrating on message property functionality
- Fixed bugs exposed by the tests.