codereview fixes for 648fed33a47b1d23ef7d6d2feeda7cd62d11e329