Fix DS definitions and other bits and pieces.