some leaks fixed
fixed mmap bug, another one remaining