Fixing a couple of bugs in the attachment loading script and test.