bug fixes and clean up.  Added is_json mixing.