Issue #14: changed initialization order of keydir to use file_id