Fix SEGV on reaching end of value array when using -d Fixes #4