Attachments will now store binary data correctly.

Fix #48
Fix regression in previous commit for issue #48