Fixed broken lastmsgof code.