Various cs fixes

And here are the cs fixes for master.