Fixed off-by-one error and capitalization