Fix handling of None values