Minor fixes.

1) fixed warning about discarding const qualifier
2) fixed linkage with c++ code
Merge pull request #4 from barthess/master

Minor fixes.