Fix extends so that it accepts a schema or an array of schemas.