Fixes #844 #5725 - correct hosts count in puppetclass

Maybe it's better to ```uniq``` the ids before searching rather than after so we only search for the needed hosts?