Fix some silly code in refs.R