Fix bug: ensure elements key is also converted