Fixed translate so search pattern no longer goes outside nesting