fix unsigned cast