Fixed error detection in expr