Fix weird inheritance bug