Improved CMakeLists and did some minor changes in the apps.