Lots of random fixes and additions