Fix fatal error when downloading files

Issue with bytes being cast incorrect resolved by decoding first
Merge pull request #35 from dancras/master

Fix fatal error when downloading files