Possible fix in reading from inputstream
Merge branch 'fix' into amazon