A lot of small fixes