Set cast parameter to avoid a deprecation warning