bug fixes to memory handling instructions