Add support for negative history indices