Fix for DATE <-> DECIMAL comparability causing #510