Improved handling of empty values