tests and fixes to broken tests