Help with waves and single quotes

I have written a very simple code to cut up a w1 wave into different waves at specific time points that are in another wave, w2:

Function cut(w1,w2)
wave w1, w2

duplicate/o/R=[w2[2]*10, w2[5]*10] w1 $(nameOfwave(w1)+"_05_1")
duplicate/o/R=[w2[3]*10, w2[6]*10] w1 $(nameOfwave(w1)+"_1_0.5")
duplicate/o/R=[w2[4]*10, w2[7]*10] w1 $(nameOfwave(w1)+"_0.5_0.75")

SetScale/P x 0,0.0001,"s", $(nameOfwave(w1)+"_05_1")
SetScale/P x 0,0.0001,"s", $(nameOfwave(w1)+"_1_0.5")
SetScale/P x 0,0.0001,"s", $(nameOfwave(w1)+"_0.5_0.75")

end

The waves I end up with are displayed in graphs with single quote around them, which is not the case in the data browser. It is not an issue generally (even though I'd like to understand why this happens) but now I want to run a piece of code which grabs waves in a graph from the root to average them. Here it gives me an error : root:w1_1_0.5 missing for example. Even though it's clearly in the root folder.
WHat is the issue here?
thanks for the help!
I can't give you much information, except to say that the decimal point in the wave names makes them non-standard and, hence, requiring special treatment. These are called "liberal" object names and need to be enclosed in single quotes when used in commands. I avoid using them so my best advice is to enter the following in the coommand line for information from the online help...

DisplayHelpTopic "Programming with Liberal Names"
As jtigor says, the use of the dot character makes it a liberal name which complicates programming. The rules are explained in the help topic he cited.

BTW, I avoid code like this:
duplicate/o/R=[w2[2]*10, w2[5]*10] w1, $(nameOfwave(w1)+"_1_0.5")

in favor of this:
String name
name = nameOfwave(w1)
name += "_1_0.5"
duplicate/o/R=[w2[2]*10, w2[5]*10] w1, $(name)

The latter style makes it possible to see in the debugger what the name actually is as well as to print out the name for debugging purposes.