Test code fixes

Test code was wrong! Fixes needed to make sure the vals are good. Test
code not good - serves me right for writing on a train early am. Works
now with no problems. Stats code is very good.