memory addressing bug fixes