some dir levels fixes and --debug parameter (will do set -x)