fixed stuff

message_end overlapping over chunk boundaries
other minor assorted fixed