Clean up and increase tests for dms