Changes to make DPat able to run multiple instances