Added fallback directory checking for #804