Lots of stuff and fixes