Fixing negative index