Added tests. Fixed latest reading.