Reordered and added tests.