Fixed ref validation