Fixes bug 602594.
mentioned in issue #66
mentioned in issue #1250
mentioned in commit 648acd6257c07629669cdfd393d2c51e78f65044