OF_inportize: fix bug and clean code