Fixed filter predicate that differentiates between structr entities, spatial entities and others.
Modified dynamic schema code to be more flexible in order to handle more different schema layouts.