Various cs fixes
Merge pull request #276 from XWB/cs-fixes-0.2

Various cs fixes