Fix edge case with nil result