Add support for API 18

Patch to add support for API 18.