Add tests for isArray and fix bug