I inverted the logic for complex setups and forgot to handle the zero cases. I also didn't notice my loop continue error. This cleans all this up so that we can have proper exported resource matching.