Added a level of indirection for file handles, since we can't rely on those being the same between machines.