Crypto bugs fixed