Closing the streams
Adding tests for cast exception and removing a redundant stream close
Merge pull request #3 from kul3r4/master

Closing the streams