Fixes test structure, adds tests