This also fixes a bug in the tests ($n was not incremented in one place). (cherry picked from commit 195277ca6d)
195277ca6d
set -e