Fix the correct cast. This fixes a problem introduced with a previous commit for new formula (commit e2e11b88499af5b49215be914760660ed9207eba )