Added array checks.