Fix default values for arguments

Properly check for undefined, using the JSLint recommendation.