fix lots of small problems