Tetsuo's memory fix patch v2