minor memsim.c changes