Fixed some bugs with the visit algorithm