Revert cert crash patch and apply upstream changes

dgraham fixed the problem upstream (negativecode/vines#37). I revert and update develop with the upstream changes!