Tighter error checking