Adding support for negative indices for INDEX

Fix issue #378