Fix vars output, make valid json