Add const in cast. Removes warning: