Fix memory mapping issue