codereview fixes for d02eb7d7d4a95640864a300f5561006faac58035