Bunch of fixes and additions