Fix a collection of random failures encountered when testing with Bazel.
12 files changed