Bugfix and a small utility to convert sqlite data into json