Fix test errors

A whole bunch of changes to try to get more of the tests passing