Fix memory initialization