CMAKE tweaks and fix compiling error for VS 2013