Fix #311
Merge branch 'master' into issue-309