Some more fixes and cleaning things up