Bunch of small fixes