Check pointers before using them in var init
Merge pull request #353 from asmaloney:arg_checks