Fixing bug where a handle wasn't closed in one of the tests