Make history elements friend to wrapper class to avoid the abuse of the setlength() method, ref #135