Fixes #1 off by one error