memory offset fixes