Fixed some CSP bugs