I just tried your full code on Mac OS X 10.7.5, PB 5.23LTS (x64) (had to change the CharUpper_() to Ucase(), but that might be no problem, will re-check this later at home)
Code compiled and started without any errors.
As mentioned, I will check again as soon as i'm home at my windows 7 PC.