cleanup
major change to edit_scandefs, some tweaks needed