Fixed mistake with memory allocation.