fixed routing bug, misc cleanup