C89 and windows fixes
Merge pull request #30 from weltling/master

C89 and windows fixes