codereview fixes for 78ec04446bee386203321b24520580224c53942d