Fixing a conversion bug and adding JSON helper

Solves #1