codereview fixes for 19883403800d24d58d68dfc448da758b9e0c29f3