Update fix for E731

Thanks to @mypalmike for thinking of the extra cases