lots of little fixes