Fixed parts of fixes for references
Fixed a few things for references