fixed end of line bug in IMI Save

IMI save function was using /r as the end-of-line character, not \n as
required by Unix.  Now fixed.