Fix support for non-ASCII keys in sessions.