fixed rmem.c