Fixes to work with dart2js, pub-build and pub-serve.