fixes from review (thanks to @mvidner)