fix off by one issues.