Add test case for #86.  Fix test cleanup so db.Close() is called.