fix a few bugs with derivation.  I think the sporadic hash failures are
a new bug in crypto-js 3.1.2. I've since rolled back to 3.0.2. Maybe
eventually a bug report should be filed....