Update LibClass.lua

Correct the handling of negative indexes.