Improved display of certificates, both for viewing and pasting, fix auto expand bug