Better NULL handling