fix things from code review (thanks to @mvidner)