Fixes #10

Thanks to @Gert-Jan for the bug report and fix.