r2 - fixed memory writing crashes happening since v103 and added some hacks