Updated old version and added some memory fixes

(hopefully they work)