Fixes index out of bounds error.

Replaces && by andAlso.