Fix toKeyString to not mutate state.