Added CryptoSafe option to constructor.  Fixed some casting and return value issues on 64-bit.
Fixed some casting issues.