More generic type checks in FluentDOM\Transformer\Namespaces\Optimize