Fixed empty message parsing and updated message parsing test to cover the case