Fixed small bug where filestream wasn't closing.