Fixed a few bugs from legacy json option
Fixed a bug from legacy prefix option
Removed pdb
Pep8