fix and add loose object test