Fix wrong dependencies being used on deserialisation.