Proper fix for calculating encoded session-key length