Revert "Replace magic constant with reference" changes Reverts r1886986, r1886987 and r1886988. Incorrect conversion between int and shorts led to incorrect logic.