Added logging statements in test script. Fixed a bug.