codereview fixes for 8a95dcbc1402dff8d564a5a318096a29d8878823