Fixed errors which were leading to incorrect parsing of message responses.