Mostly compilation fixes. It seems that CMAKE has some bug when using shared libraries built by the project on VS2013 (it insists that they should be static). Well, I have decided to temporary use just static libs.