codereview fixes for 8b26aa3c3228da94add8745da4a11fc7cbedff1f