Fix invalid variable reference