diff --git a/lib/src/asset/dart/serialize.dart b/lib/src/asset/dart/serialize.dart
index 7af294171080c45bf04820e8a4dd77d20e0e3000..09b44c54001033dfd831d3b907d3182c0f2a3768 100644
--- a/lib/src/asset/dart/serialize.dart
+++ b/lib/src/asset/dart/serialize.dart
@@ -108,7 +108,7 @@ Stream/*<T>*/ deserializeStream/*<T>*/(Map stream,
     var receivePort = new ReceivePort();
     stream['replyTo'].send({'replyTo': receivePort.sendPort});
 
-    var controller = new StreamController(sync: true);
+    var controller = new StreamController<T>(sync: true);
     receivePort.listen((event) {
       switch (event['type']) {
         case 'event':
diff --git a/lib/src/error_group.dart b/lib/src/error_group.dart
index be3d067b84a593c56b2ed966417b06e40205a100..407bbc6bb62a3c8dca7ad3a006904e085d66ff4d 100644
--- a/lib/src/error_group.dart
+++ b/lib/src/error_group.dart
@@ -188,7 +188,7 @@ class _ErrorGroupFuture<T> implements Future<T> {
     _completer.future.catchError((_) {});
   }
 
-  Future/*<S>*/ then/*<S>*/(onValue(/*=T*/ value), {Function onError}) {
+  Future<S> then<S>(FutureOr<S> onValue(T value), { Function onError }) {
     _hasListeners = true;
     return _completer.future.then(onValue, onError: onError);
   }
diff --git a/lib/src/source.dart b/lib/src/source.dart
index ca18f811867fba4bb0ef78db9da535e599c0990b..9e5153ac755891032b3848404d68c469349649a1 100644
--- a/lib/src/source.dart
+++ b/lib/src/source.dart
@@ -10,7 +10,6 @@ import 'exceptions.dart';
 import 'package.dart';
 import 'pubspec.dart';
 import 'system_cache.dart';
-import 'utils.dart';
 
 /// A source from which to get packages.
 ///