Fixed "comparison between signed and unsigned" warning