Fix and clean up tests. Remove deadends.