some improvements. Crypt test still fail :(