Fix adapter creation bug.