Fixed error detection