More accurate check for empty values