Fixed JSHint errors and warnings.