Fixed bug with null values