Issue #2204257 and #2266637 by japerry, andyg5000: Update incorrect views optimization patches