Lots of little fixes.