fixed Henry's issues, BLOB to Blob, removed improper casting and function not found errors