fix test to avoid index errors + typo

This still shows an erroneous behavior