JSHint enabled, detected problems fixed