codereview fixes for 9df80de12eb44fe91ee4aaeb5cd53f71a687f3a9