Check and fix i=1 and i=N cases for (#) in {(0),(1),(2),(3),(4),(5)}.