Fix minor bugs that Dart wasn't telling me about in production mode.

Very surprising.