Fix issues when passed param is missing, "undefined", or "null"

Test Plan: jshint. Any better ways to test, since this is in its own repo?

Reviewers: Mihai, steph

Differential Revision: http://phabricator.palinka.me/D1738