codereview fixes for 140b5abdd1657b5553aae5f3e30d10ef988fb4f9