Fix leaking environment bug
Example of ancestor matching + some new patterns

+ improve the match action builder