a few CDI related fixes

Hi folks!

I've fixed a few CDI related issues. Please see the commit comments for more info.

LieGrue,
strub