Improve tests, still needs some cleanups