fixed some issues but lots of tests are still breaking