Fix issues highlighted by @stof on first code review