Fix for #2214.
Merge branch 'daniel_2214' into next