lots of little UT fixes