fixed various bugs relating to reading/writing blobs from external
files. #49