Fixing lots of crap and tidying things up