Better dir existence and permissions checks