Fix issues identified in Phabricator code review