More *nix fixes.

-Added the debug flag to the cmake, if this is a no no, my bad.
-Fixes my earlier fix to init glew
-Fixes a segfault caused by gcc vs msvc parsing differences (I think? @Bigpet is the expert on this one)

Sorry about the pull-request spam. At least little pull requests are easy to revert when I break **everything**