Fix issue 538

See issue #538