CS and logic fixes.