fix empty sequence error in polyfit