issue 1237: Fix stack corruption bug in dump table logic