Fix _last_id after opening old DB (closes #34)