Backport nullability fixes from master