BytesIO TypeError

This addresses #3. I've made it another PR so that it runs against travis.