Set prev field when reading json

Fixes #877