Fixes to json, operations and main