fixed up invalid references