Clean-up and fixed errors in dsm
Clean-up