Fix lore memory allocation