Fix wrong mmap size
Check if mmap has failed