Transferred fix for #13 to production branch