Fixed a bug with variantToPosition.