DBC fixes and code clean up

This is fixes from DBC and a single fix in relation to the new flag module version.