Synchronize with genotyping

Patched in bugfixes from genotyping made since the code was split