Command retry and JSON hacks