#347: template search fixed.