Fixed IllegalStateException issues with json