More verbose error messages

Basic "invalid table mark-up" error is not helpful - had to dig through code to find what was wrong even when the problem was that no element was selected. This should make debugging easier.