Fix bug in the truncate function.

The truncate function should be displaced to the left when the large
array size is odd and the truncated array size is even. However, when
the large array size is even and the small array size is odd, it
should be displaced to the right (in 1D for an array going from left
to right). The fix enables this behavior. The changed notebook demos
the problem.

The first test case in the notebook seems to work. I'm not sure about the second one. Be sure to include both these test cases in the test suite.