Fixed some code errors a la JSHint