[BUG #7142] applying patches from master, fixing various dangling comment issues