Changed literal handling

Literals are only replaced by their constant values when used in sets.
This was done so it will not conflict with loops and such. 

If "i" in the loop was replaced by the constant 1, then when you
incremented "i", it would not be seen because that node was completely
replaced with the constant 1.
Small/Tiny fixes

Made some changes to the statement flow which caused an error to get
flagged multiple times.