Fixes #501 with minor change ...