Trying to track down the unexpected end of file exception