Added support for jailing - and fixed definition of "datadir" variable.