Minor bug fixes and improvements in memory menagement modules.