Fix for undefined variable in the addCollector() method

The `addCollector()` method was throwing an exception that referenced an undefined variable. I also updated the method comment slightly to include @throws and @return.