Fixed a segfault: a memory object was beeing freed twice