Fix cleanup code for scan_test.go