Updated in-memory variant example

NewVariant returns a variant and an error.