Added support for custom extension.