Tweaks for leaving search

- Remove redunduncy from the code paths	for closing search
- Add some comments