fixing sign problem in base-index format.