Fix for issue #17

Fixes the bug described in issue #17.

Best regards,
Marius