Primitive element tests.
Added edge case for primitive element generation.
Fixed roots test case.