Added longestCommonPrefix method to BaseNValue