Bunch of fixes

Much nicer.