Fix handling nil