Added lengthy method for checking string/array lengths.