Added some error prevention to set/get functions
fixed conflict in jsonmain.cpp