Adding some unit testing and fixes for addRow