Add casting for SilverStripe 3.1 compatibility