Add coverage in test_utils, fix orphan bug