Fix :class inheritance when you have references