Support new args in getByKey.
Fix fatal errors in tests.
Update getByKey tests with new args.