Some fixes but tests are still hanging