Added proper Array check with tests