fix bug in dump() (thanks Sarah)