0.4 fix reading direct mode & add unit test for all mode reading code.