Code cleanup; fixed selection operator

.. and memoized templategroup-matches