Fixed bug in osis2dita.py. Fixed some other referencing bugs