Fix issue "Use of uninitialized value $val in substitution line 3312". Thanks to bricklen for the report.