Corrected merging in of fix for #2368 so it also applies to medium view.