Improve handling of empty values