heap: merge changes from trunk



[SVN r85191]
heap: merge fixes from trunk



[SVN r85437]