Fix issue where literal strings were being overly greedy and were not being unreplaced in some instances