Fixes build and tests

Still so many tests...