Fixed so null values and decimals are handled correctly.