Change order of test assertions to make them more reliable