Some fixes in Bernstein coefficient extraction algorithms