Fix some bugs in GCD Product