Bug fix, updated test script