Refactor
Fix bad preconditions of tests