Code review

Hope this works but I have not CMake 2.8.11 to compile it.
If not, just revert this commit.