Fix issues raised in code review

Fix two issues @mmp pointed out in code review.