Fix Ledger bugs