Improved error checking in the object loader
Added negative indices support.