Finished the final unit tests for the xml model reader and fixed some bugs found from them.