More cleanup, work on tests [ci skip]