Bug fixes to read messages