Fix issues raised during code review