fix for evaluation at last node

Fixes an index problem for evaluation at the last node.