Merge "Improve handling of Invalid Operation exception"