Fix for Issue #2

Thanks to averias for pointing out the bug