This was a bug -  comment mode was not reset at the end of a comment.