Hotfix for #1078 and #1038