Further bugfixing, slightly cleaned table code.