Use custom shouldVisit if specified

Fix for Issue #9.