Fixing issue #6, reported by @GDmac.