Fix cs and an undefined variable