Addressed code review feedback, and corrected a potential warning.