Fixed a bug in certificates