Fix certificate size calculation bug introduced in commit 47d33f1e