Fix self ref issue