Move checkRefIsValid up