A bunch of little fixes here and there