How is it possible that neither if nor else branch gets executed here?
It was a character encoding problem in the source file. I changed the encoding in my favorite  text editor, and the code started working.