Fixed JavaScript JSON encode