Handle an empty string as None