Added cast in conditional to prevent signed/unsigned comparison, and wrapped argument...