Fix most unit tests