hpc related bugs

 - export global variables and packages to workers
 - fix save bug in mi.R