Improved support for recursion - need to test with more complex patterns
Add further tests