Fixed ref error causing argument errors.