Memory bugfix