Fixing a conversion bug and adding JSON helper

closes #1