Fix memory addressing