Tests rewritten