Fix bugs in exporting dirl