Add support for class instances to delta.apply