cleanup source swap UI, fix #652, fix #792