Casting results (bool/int/float), partially merged @vdvleon commit 41c6aca