Added optional metadata_timeout parameter.