Some fixes

Have a look at some advices to make your code more C++ like