Fix when getting no msg, add tests