Rework patch from poying to keep JSLint happy