Fix gentest.
Fixes and more thorough tests.