BUG 14066, 14065 - cope with empty document and assertion for invalid table
Whitespace tidyup