Fix issue #3

An amazingly large contribution :)