Fix bug in pdf output