Error checking fixed.