Update to use correct json_tools version
Fix some memory issues
Some small fixes

Most importantly fix the path verification for directories.