Will not calculate invalid reference number on nil argument.
Merge pull request #1 from mtiigi/731_nil_argument_fix

Will not calculate invalid reference number on nil argument.