Fix for #408 (and #78)