Added reader tests and some minor fixes