OP solved this issue by finding conflicting gcode preamble in his .ini file.
I read through this whole thread and agree with OP. The first guy to reply was ridiculous.
Mem is an industry standard term. By default LinuxCNC is always in 'mem'. On regular machines (ie. Every CNC machine with a controller that isn't homebuilt MEM refers to when the program is loaded to be run and no longer in EDIT. It basically locks out the open program so it cannot be modified by any inputs. You usually go into MEM when you are ready to run the program. EDIT when you are making changes, MDI when you are jogging etc.)