many more fixes to help pass tests and other miscellany