are you using var_ref to refer to variants? Does this work properly? I'm not saying it shouldn't but I'm not sure I would expect it to either...