Fix a cast that generate warning during build