mmap bug fixed, test updated