Made some tidy-ups DMS working better now