A bunch of little fixes