Fix narrowing warning withe explicit cast