Fixup! implemented ``cast`` scalar function