Bugfix in the C code.
Properly documenting C code.

Also added some small changes to the required arguments.
Changelog.
Changed  to