Bunch of little fixes