Fixed unexplained pdf corruption