Devel: Fixed CMake problem and 2 build errors under Visual Studio

Please, refer to the self-explanatory diffs of the pull merge. 

Cheers,
Jose Luis