additional changes for issue #366