codereview fixes for 7f0e58fd95f71e9e403fac43e5fade2e7c977bc6