Fixes debug error when killing mon_dementia.

Fixes #5164.