Fix Issue #120 (key collisions in ephemeral driver)

and add unit tests for this as well as for issue #84