some fixes on double division