Cleaned up some return code handling, and added test for binary blobs