Fix filtering of visits by affiliate ID. Closes #201