fix conversion between numbers and JSRef