Multiple fixes, better IV generation for crypto