Added autodetect of ENCLOSURE variable
Added root check