Fix some tests and add json dep.