Fixes issue with wrong inheritance order