correct placement of #endif
Merge pull request #39 from danlin/master

correct placement of #endif