Added message parsing code.