Build cleanly on the Mac again, fix JSON encoding issues.