simplify some code. Let setIndex determine if it should do something or
not ( < 0 is considered invalid).