Fix compile issue with friend class