Merge pull request #1002 from dart-lang/fix-crashes

Fix a couple of crashes I found when testing the migration on a corpus.