JSHint & related fixes