Handling of nil result at the end.