``$values`` is undefined here (which makes me think that this code is currently not tested)