Can we move this line and the two below it to the if statement a little further up?
It also checks `if (session.debug && !isSigning)`. Would clean up the code a bit.