More bug fixes
off by one