Applying @xioahutai's fix in 8ddc14cc2eb21d4a29234055dee8bf89a1721383 to feature/bolt2