Fix bug in cobs code