Fix inheritance and more const-ness