Safer isArray test

resolves #3