Fix inaccurate JS source pieces substitution