Various cs fixes
Merge pull request #283 from XWB/cs-fixes-master

Various cs fixes