Fixed a bug in parse_message