fixed up JSON parser
more tweaks