Fixed an issue with the from(Reader) added a bunch of unit tests.

fixed a problem @fommil noticed in #840