	public function normalizeValue($value, ElementInterface $element = null)
	{
		// Convert string representation from db into plain array/int.
		if (is_string($value)) {
			$value = Json::decodeIfJson($value);
		}

		if (is_int($value)
			&& $this->allowMultiple) {
			// Int, but field allows multiple, convert to array.
			$value = [$value];
		} else if (is_array($value)
			&& !$this->allowMultiple
			&& count($value) == 1) {
			// Array, but field allows only one, if single value, convert.
			$value = intval($value[0]);
		}

		// Convert string IDs to integers (for pre 1.1.0 data).
		if (is_array($value)) {
			foreach ($value as $key => $id) {
				$value[$key] = intval($id);
			}
		}

		return $value;
	}