improved unit testing for loadArray and fixed a minor bug