Fix issue 575

See discussion in #575