Fixed so that the pivot command returns descriptive error messages when illegal indices are given.