Fixed alloc bug causing chain of pointers to be created.