Fix cert dir and many other bits