A whole bunch of little fixes