Possible fix for #2093. Needs testing / user feedback.