Fixed bug in key derivation again