(bug-fix) Fixed setting of current memory