Fix is not defined errors

Some browsers (such as chrome) will throw a `variableName is not defined` error if you try to pass a variable that is not declared (as parameter or trough a `var` statement)