diff --git a/lib/liquid/htmltags.rb b/lib/liquid/htmltags.rb
index 16efb718..1763587c 100644
--- a/lib/liquid/htmltags.rb
+++ b/lib/liquid/htmltags.rb
@@ -46,7 +46,7 @@ module Liquid
'col0' => col,
'index0' => index,
'rindex' => length - index,
- 'rindex0' => length - index -1,
+ 'rindex0' => length - index - 1,
'first' => (index == 0),
'last' => (index == length - 1),
'col_first' => (col == 0),
diff --git a/lib/liquid/tags/for.rb b/lib/liquid/tags/for.rb
index 247f0958..c66a6810 100644
--- a/lib/liquid/tags/for.rb
+++ b/lib/liquid/tags/for.rb
@@ -110,7 +110,7 @@ module Liquid
'index' => index + 1,
'index0' => index,
'rindex' => length - index,
- 'rindex0' => length - index -1,
+ 'rindex0' => length - index - 1,
'first' => (index == 0),
'last' => (index == length - 1) }