Allow replacing visitors to return undefined. Fixes #2252