Fixed error check.