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

Further enhancement on #804.