(Types) For and by Damien, adding static castBoolToInt function