Fix memory locations