fix many JS->Dart problems