Fix calculation of table foot.

The arguments tablefoot_last and tablefoot were switched erroneously.
(Also removed a debugging statement)