Fixes for CMS7

I'm sure I messed up somethings, rst is a mystery to me