fix issue #38, as mentioned by @jdputsch