Fix a number of null result handling issues.