Fixed bug with NotFoundException

Fixed bug with NotFoundException when unsubstituted
variable appears instead of given value.

Change-Id: Icd2e2b7b0b75e88926cb6d355ccf5e03cf5dc423
Closes-bug: #1354421
Merge "Fixed bug with NotFoundException"