Fix and test issue #320