Fixed up scripted test as a result of needing to handle an exception being thrown. The test should now be a lot more resilient.