Fix bug with null values