Fix bad adapterFor lookup and add tests