Fixed error printing issues.