Better handling of NULL values