Lots of small fixes!