Fix a few minor bugs found with a static analyzer
Fix cases in which intra refresh allowed prediction from disallowed pixels