Bugfix for issue #35

Hi guys. This issue has been open for a long time. I provided a fix in bitbucket but got no response. I really hope this fix will be pulled into CI. I hope to receive some feedback if you decide not to. Cheers! Bas