Lots of corrections to references markup