Move duplicate checking till after routing. Should fix several subtle