Add directory fallback mode.
Improve dir listing functions.
Improve fallback detection