fix segfault on groovy, not tested on fuerte see #4
Merge pull request #8 from k-okada/master

patch to avoid segfault