Fix segfault due to faulty copy ctor