Added checking for arrayness