Fixing some issues from the last commit in adapter.js.