Merge pull request #37 from alexfru/master

Smaller C fixes and improvements.