Fix warnings in newer JSHint, and improve variable names.