Fixes fatal errors

Still 4 failing tests.