several bugs related to BCS calculation