fixed bug in ``primitive_root``; increased coverage