fixed int->double bug from Javascript