Added plnyyank's fix to issue #66