codereview fixes for c930af83b0b576e7ab804efa7a7b2ba4bad43994