Fixed crash when class missmatching on relations