Better array checking