fixes and cleanup

fixes slag, scriptorium issues. minor changes to the GUI and utility cleanup.