Add coverage and fix ordering issue in a test.