Fix segfault in debug-dump

Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>