Clean up dead ends.