Updated test script to fail on any error.

Also added comments.