Fix certificate generation