Speed up - Fix comparison of amd modules

Check if we should even match ast with parent type - and if not skip all it's children