Ported CS fixes