Fix issues raised during code review (2nd round)