fixed compilation warnings
all indices must be unsigned