Fixed compilation issues, but functionality not tested
Some minor changes and some documentation