add DRY_RUN/DEBUG variables and various small fixes