Bunch of fixes and style changes