codereview fixes for 6b6a09a265ad9a19604b3a4fca5bc2e1bd83f67f