Fix invalid reference usage