fixed compile bugs for friend constructors