Fix bug and add regression test
put jsonOptions back in