Added support for extracting optional values.