Fix calculation sign() of Mul, see issue 3677

This patch also includes missing tests for issue 847.