Unit tests for Read and bug fixes