Correction to type checking of nil returns, fixes #230