Fixed. I'm completely re-writing read_msg, and missed something there. I've put the old version back until I get to that.