Fix bug in BLOB handling and NULL handling