Improve frame error detection