Fixed logic for hiding empty values.