Fixed runtime errors with the SQLite writer