Fixes bug with invalid heritance