Forum:Why switch doesn't work with PAGENAME

The templates below import following template: It seems that if you fill parameter with string that contains: ', manually it will work, but if you do it with PAGENAME it won't. In the same time if string doesn't contains ', it will work normally in both cases. Look at the source codes for better understanding.
 * Template:Im'provisation
 * Template:Improvisation 2