Merges https://github.com/espressif/esp-idf/pull/701
This is to resolve issue reported in https://github.com/espressif/esp-idf/issues/130.