bug fix for converting dot products into linear factors