Fix js issue with non-numeric ids

Closes #658