some mmap bugfixes. no effect on tests.