Cast idents to strings when using them as a hash keys. Closes #1735