Added support for strict-checking of the base-dir, plus code improvements