Bug-fix for static variables as proposed by Kota Iguchi.

Fixes #20.