Error raised if the old definition returns null

If a closure type definition returns a null value, extending the
definition will raise error. Fixed to throw an appropriate exception.
Update changelog and version