Fixed a bug with the site crashing occaisionally when doing references.