Bunch of small bugs and changes