more fixes for dump function