Bug fix involving invalid characters in read documents