I kept receiving the following error number, -1073741571.
After typing "-1073741571" into Google, I found this post on a French programming forum.
Apparently the problem may be caused by some kind of 'overflow' error. The fact that the program uses recursion makes me feel that this may be right.