Created a new patch to replace existing IDF export code and fix bugs in the IDF source code