manual merge of PR #330