Add test case and tenative fix for issue #314
Make Dictionary enumerator implementation more robust since the old hack isn't adequate after the #314 fix