Fixed crash

Objects returned by reference shouldn't be used to create new objects