Use transaction when finding reachable features. Minor code cleanup.