Solidworks 2017 Selection Macro Error

We have a macro that in previous versions of Solidworks, was able to cycle through the planes of a part. This macro helps us to mate quicker as we can quickly grab the planes on two parts and mate using just hotkeys. After upgrading to 2017, we have noticed this macro is no longer stable. It seems it will work for the first few minutes of using it and then randomly will error out on "Set swFeat = swSelComp.FirstFeature". It also seems this issue is only when selecting parts inside of assemblies. Again, this macro worked fine before 2017. Maybe these calls have changed in 2017?

Thanks

SolidworksApi macros