(bluefox) fix some errors in adapter.js