Adjusted .min. checks for better accuracy.  Added is_writable directory checks