Small optimization: a palindrome cannot end in 0