Manual port of "Debug message was incorrect" from v1.2.3