fixed bugs with formatter not properly dealing with null values