CS fixes, as per @juriansluiman