1. Tests for the nth() method.
2. Some code simplification in other functions.