Bugfix for memory related crashes