save string length from Ruby and JS, fix JSON parser.