Fixed JSHint errors and variable names