Assert the token's block is not nil and check it before execution

Further enhancements on #804.