fixes to egefac() logic

Replaces #7402