Fixed adapter factory.

Change-Id: If0c0058a08eb1907f4a81ea072fcee5aaf4fce56