Treat zero-length strings as nil, failing gracefully for inconsistent APIs